home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / vm-cms / texshell / printtex.xedit < prev    next >
Text File  |  1993-09-27  |  5KB  |  139 lines

  1. /********************************************************************/
  2. /* Package  : TeXShell for CMS, version 2.00                        */
  3. /* Author   : Humberto Jose' Bortolossi                             */
  4. /*                                                                  */
  5. /* Bitnet   : hjbortol at brlncc.bitnet, hjbortol at brfuem.bitnet  */
  6. /* internet : hjbortol at impa.br                                   */
  7. /*                                                                  */
  8. /* Organizations : Instituto de Matematica Pura e Aplicada (IMPA)   */
  9. /*                 Fundacao Universidade Estadual de Maringa'       */
  10. /*                                                                  */
  11. /* Copyright : This program is freely distributable.                */
  12. /*             You can do changes but, please, keep my name.        */
  13. /*                                                                  */
  14. /* Description : This macro xedit is used to print DVI files on  a  */
  15. /*               printer. You must modify this macro to your local  */
  16. /*               system (I guess it would not be difficulty).       */
  17. /*                                                                  */
  18. /*                                          (C) Copyright 1992-1993 */
  19. /********************************************************************/
  20.  parse arg fm
  21.  
  22. 'execio 1 diskr PRIMARY FILE' fm '(FINIS'
  23.  pull fn ft .
  24.  
  25.  set emsg off
  26. 'listfile TEXSHELL CONFIG * (ALLOC NOHEADER STACK'
  27.  if rc /= 0 then do
  28.     say 'File TEXSHELL CONFIG * not found.'
  29.     say 'Taking K as fonts disk.'
  30.     Dropbuf
  31.     Disk_fonts = 'K'
  32.  end
  33.  else do
  34.     pull . . FileMode . . NumberOfLines .
  35.     DropBuf
  36.    'execio' NumberOfLines 'diskr TEXSHELL CONFIG' FileMode '(FINIS'
  37.     do forever while queued() /= 0
  38.     pull Label Information .
  39.     if Label = 'FONTS_DISK' then do
  40.                                  Disk_fonts = substr(Information,1,1)
  41.                                  DropBuf
  42.                             end
  43.                             else Disk_fonts = 'K'
  44.     end
  45.  end
  46.  
  47.  
  48. 'listfile TEXSHELL CONFIG * (ALLOC NOHEADER STACK'
  49.  if rc /= 0 then do
  50.     say 'File TEXSHELL CONFIG * not found.'
  51.     say 'Taking 3820 as printer.'
  52.     Dropbuf
  53.     Disk_fonts = 'K'
  54.  end
  55.  else do
  56.     pull . . FileMode . . NumberOfLines .
  57.     DropBuf
  58.    'execio' NumberOfLines 'diskr TEXSHELL CONFIG' FileMode '(FINIS'
  59.     do forever while queued() /= 0
  60.     pull Label Information .
  61.     if Label = 'PRINTER' then do
  62.                                  Printer = Information
  63.                                  DropBuf
  64.                             end
  65.                             else Printer = '3820'
  66.     end
  67.  end
  68.  
  69.  
  70. say 'First page (default is 0)?'
  71. parse pull first_page
  72. result = datatype(first_page)
  73. if result = 'CHAR' then first_page = 0
  74.  
  75.  
  76. say 'Last page (default is 99999)?'
  77. parse pull last_page
  78. result = datatype(last_page)
  79. if result = 'CHAR' then last_page = 99999
  80.  
  81. number_of_pages = (last_page - first_page) + 1
  82.  
  83.  
  84.  
  85.  select
  86.  when Printer = '3820' then do
  87.     'exec dvi3820' fn '(' first_page number_of_pages
  88.      say
  89.      say 'Wait a while. Processing file.'
  90.      say
  91.     'laser on 2 nodisp standard'
  92.  /* 'PRT3827' FN 'LIST3820 A (FONT (* FONT3820' DISK_FONTS') SE)' */
  93.  /* 'PRT3827' FN 'LIST3820 A (OPTIONS(TEX OPTIONS *))'            */
  94.     'PSF' FN 'LIST3820' FM '(OPTIONS(TEX OPTIONS *))'
  95.  /* 'PSP' FN 'LIST3820 A (OPTIONS(TEX OPTIONS E))'                */
  96.     'erase' fn 'LIST3820 *'
  97.  /* 'CP SPOOL PRT CLASS A FORM STANDARD DEST OFF'  */
  98.     'laser off 2 nodisp'
  99.  end
  100.  
  101.  when Printer = '3812' then do
  102.     'exec dvi3812' fn '(' first_page number_of_pages
  103.      say
  104.      say 'Wait a while. Processing file.'
  105.      say
  106.  /* 'CP SPOOL PRT CLASS L FORM STANDARD DEST PR3827' */
  107.     'PRT3827' FN 'LIST3812 A (FONT (* FONT3812' DISK_FONTS') SE)'
  108.     'erase' fn 'LIST3812 *'
  109.  /* 'CP SPOOL PRT CLASS A FORM STANDARD DEST OFF' */
  110.  end
  111.  
  112.  when Printer = '38PP' then do
  113.     'exec dvi38pp' fn '(' first_page number_of_pages
  114.      say
  115.      say 'Wait a while. Processing file.'
  116.      say
  117.   /*'CP SPOOL PRT CLASS L FORM STANDARD DEST PR3827' */
  118.     'PRT3827' FN 'LIST38PP A (FONT (* FONT3812' DISK_FONTS') SE)'
  119.     'erase' fn 'LIST38PP *'
  120.   /*'CP SPOOL PRT CLASS A FORM STANDARD DEST OFF' */
  121.  end
  122.  
  123.  otherwise do
  124.     'exec dvi38pp' fn '(' first_page number_of_pages
  125.      say
  126.      say 'Wait a while. Processing file.'
  127.      say
  128.     'PSF' FN 'LIST3820' FM '(OPTIONS(TEX OPTIONS *))'
  129.  /* 'CP SPOOL PRT CLASS L FORM STANDARD DEST PR3827' */
  130.  /* 'PSF' FN 'LIST3820 A (OP (TEX OPTIONS A))' */
  131.  /* 'PSP' FN 'LIST3820 A (OPTIONS(TEX OPTIONS E))' */
  132.     'erase' fn 'LIST3820 *'
  133. /*  'cp spool prt class a form standard dest off'   */
  134.  end
  135.  end
  136.  set emsg on
  137.  
  138.  exit 0
  139.